<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.List"%>
<%@page import="com.jaxplat.commons.Row"%>
<%@page import="com.jaxplat.commons.RowImpl"%>
<%@page import="com.rs.rsbiz.reserve.entity.ReserveOrder"%>
<%@page import="com.jaxplat.util.DateUtils"%>
<%@page import="com.rs.rsbiz.reserve.entity.ReserveOrderBill"%>
<%
    String contextPath = request.getContextPath();
    ReserveOrder lockedOrder = new ReserveOrder();
    if (null != request.getAttribute("lockedOrder") && request.getAttribute("lockedOrder") instanceof ReserveOrder)
    {
        lockedOrder = (ReserveOrder) request.getAttribute("lockedOrder");
    }
    Row dsInfo = (Row) request.getAttribute("dsInfo");
    ReserveOrderBill orderBill = (ReserveOrderBill) request.getAttribute("orderBill");

    String userId = (String) request.getSession().getAttribute("usessionid");
    List reservOrderList = null;
    String pagingHtml = "";
    if (null != request.getAttribute("reserveOrderList"))
    {
        reservOrderList = (List) request.getAttribute("reserveOrderList");
    }
    else
    {
        reservOrderList = new java.util.ArrayList();
    }
    if (null != request.getAttribute("pagingHtml"))
    {
        pagingHtml = (String) request.getAttribute("pagingHtml");
    }
%>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<head>
    <meta name="keywords" content="<%=session.getAttribute("keywords") %>" />
    <meta name="description" content="<%=session.getAttribute("description") %>" />
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>预约管理-云南移动无线城市</title>
	<link type="text/css" href="../css/wap.css" rel="stylesheet" />
</head>
<body>
<%=session.getAttribute("headerContentWeb")%>
	<div class="wap">
		<div class="navW">
			<div class="marginAout navIn">
				<span class="current"><a
					href="<%=request.getContextPath()%>/wap/index.jsp?portaltype=1&version=2&areacode=<%=session.getAttribute("areacode") %>">预约管理</a>
				</span><span><a
					href="<%=request.getContextPath()%>/wap/doctorAction.do?method=initSearch_s1">预约挂号</a>
				</span><span><a href="<%=request.getContextPath()%>/wap/guide.jsp?portaltype=1&version=2&areacode=<%=session.getAttribute("areacode") %>">用户指南</a>
				</span>
			</div>
		</div>
		<div class="bread_nav">
			<a
				href="<%=request.getContextPath()%>/wap/doctorAction.do?method=initSearch_s1"
				class="current">首页</a><a href="#">&gt;</a>
			<a
				href="<%=contextPath%>/wap/reserveManageAction.do?method=reserverOrderList&flag=<%=request.getAttribute("flag")%>">预约管理</a>
		</div>
		<div class="ma_select">
			<!-- 如果用户没登录则不显示 -->
			<%
			    if (null == userId || "".equals(userId))
			    {
			%>
			<div class="right_main_box_cont" align="center">
				<ul class="navlist">
					<a href="<%=session.getAttribute("wapLoginUrl")%>"><font size="3px"> <strong> “您还未登录，请登录”</strong> </font></a>
				</ul>
			</div>
			<%
			    }
			    else
			    {
			%>
			<form id="form1" name="form1" method="post"
				action="<%=request.getContextPath()%>/wap/reserveManageAction.do?method=reserverOrderList">
				<div>
					订单状态：
					<select name="flag" id="flag" style="width: 100px;">
						<option value="1" <%if ("1".equals(request.getAttribute("flag"))) {%> selected="selected" <%} %>>
							未支付预约
						</option>
						<option value="2" <%if ("2".equals(request.getAttribute("flag"))) {%> selected="selected" <%} %>>
							我的预约
						</option>
						<option value="3" <%if ("3".equals(request.getAttribute("flag"))) {%> selected="selected" <%} %>>
							历史预约
						</option>
					</select>
					&nbsp;&nbsp;
					<input type="submit" class="btnN2" value="查询" />
				</div>
				<p>
					（请选择订单的状况进行查询，我们将为你查出最近三个月的预约记录）
				</p>
		</div>
		</form>
		<div class="h_div">
			<h1 class="h1">
				<%
				    if ("1".equals(request.getAttribute("flag")))
				        {
				%>
				未支付预约
				<%
				    }
				        else if ("2".equals(request.getAttribute("flag")))
				        {
				%>
				我的预约
				<%
				    }
				        else if ("3".equals(request.getAttribute("flag")))
				        {
				%>
				历史预约
				<%
				    }
				%>
			</h1>
		</div>
		<%
		    for (int i = 0; reservOrderList != null && i < reservOrderList.size(); i++)
		        {
		            RowImpl row = (RowImpl) reservOrderList.get(i);
		%>
		<div class="tab_containt">
			<p>
				<span class="span_b">订单编号：<%=row.get("orderId")%></span>
			</p>
			<p>
				<span class="span_b">支付状态： <%
				    if ("1".equals(row.get("payStatus").toString()))
				            {
				%>
					未付款 <%
				    }
				            else if ("2".equals(row.get("payStatus").toString()))
				            {
				%> 已付款
					<%
				    }
				            else if ("3".equals(row.get("payStatus").toString()))
				            {
				%> 已退款 <%
				    }
				%>
				</span>
			</p>
			<p>
				<span class="span_b">患者姓名： <%=row.get("applicantName")%></span>
			</p>
			<p>
				<span class="span_b">手机号码： <%=row.get("mobileNo")%></span>
			</p>
			<p>
				<span class="span_b">医&nbsp;&nbsp;&nbsp;&nbsp;院：<%=row.get("hospitalName")%></span>
			</p>
			<p>
				<span class="span_b">科室类别：<%=row.get("sectionName")%>-<%=row.get("secType")%></span>
			</p>
			<p>
				<span class="span_b">医&nbsp;&nbsp;&nbsp;&nbsp;生：<%=row.get("doctorName")%></span>
			</p>
			<p>
				<span class="span_b">预约时间：<%=row.get("reserveTime")%></span>
			</p>
			<p>
				<input type="button" class="btnN2" value="查看"
					onclick="location.href='<%=request.getContextPath()%>/wap/reserveManageAction.do?method=viewReserveOrder&flag=<%=request.getAttribute("flag")%>&orderId=<%=row.get("orderId")%>'" />
			</p>
		</div>
		<div class="line_wap">
		</div>
		<%
		    }
		    }
		%>
	</div>
	<div>
		<p class="page"><%=pagingHtml%></p>
	</div>
<%=session.getAttribute("footerContentWeb")%>
</body>
</html>